import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/banner/list',
    method: 'get',
    params: query
  })
}
export function changeStatus(query) {
  return request({
    url: `/banner/${query.id}/updatestuats.action`,
    method: 'get',
    params: { statflg: query.statflg }
  })
}

export function updateBanner(data) {
  return request({
    url: `/banner/updateBanner.action`,
    method: 'post',
    data
  })
}

export function deleteById(data) {
  return request({
    url: `/banner/${data.id}/deleteSingleBanner.action`,
    method: 'get'
  })
}
export function deleteAll(data) {
  return request({
    url: `/banner/deleteAll.action`,
    method: 'post',
    data
  })
}
export function createBanner(data) {
  return request({
    url: `/banner/createBanner.action`,
    method: 'post',
    data
  })
}